var dbConfig = require('../util/dbconfig')

setUser = (req, res) => {
    let { username, password } = req.body
    console.log({ username, password }) 
    let sql = `insert into user(username,password) values(?,?)`;
    // let sql = `select * from user`;
    var sqlArr = [username,password];
    var callBack = (err, data) => {
        if (err) {
            res.send({
                code: 400,
                msg: '添加失败',
            })
        } else {
            res.send({
                code: 200,
                msg: '添加成功',
            })
        }
    }
    dbConfig.sqlConnect(sql, sqlArr, callBack);
},

    module.exports = {
        setUser,
    } 